package com.xixilala.video.practices

import android.opengl.GLSurfaceView
import android.os.Bundle
import android.view.*
import com.xixilala.video.base.BaseFragment
import com.xixilala.video.jni.PngImageUtil
import com.xixilala.video.views.TriangleGLSurfaceView

/**
 * 学习 Android 平台 OpenGL ES API，学习纹理绘制，能够使用 OpenGL 显示一张图片
 */
class Practice6Fragment : BaseFragment() {

    private var mGlSurfaceView :SurfaceView ?= null

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {

        mGlSurfaceView = SurfaceView(mActivity).apply {
            layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)
        }
        PngImageUtil().init(mGlSurfaceView!!.holder.surface)
        return mGlSurfaceView!!
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)


        mGlSurfaceView?.run {



        }
    }
}